﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeFile="ServerInfo.aspx.cs"
    Inherits="ServerInfo" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>来话宝 <%=FTchina.Library.MasterHelper.ClientTitle %>-短 信 平 台 账 号 管 理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link href="/images/style.css" rel="Stylesheet" />
    <script language="javascript" type="text/javascript" src="/js/jiazai.js"></script>
    <script src="/js/introbox.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
    <script language="javascript" type="text/javascript" src="/js/jquery-easyui/jquery.easyui.min.js"></script>
    <script language="javascript" type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" type="text/javascript" src="/js/pagefunction.js"></script>
    <script language="javascript" type="text/javascript">

        function ChangePsw() {
            var url = '<%=serverUrl %>';

            var uname = $("#txbuname").val();
            var txboldpsw = $("#txboldpsw").val();
            var txbnewpsw = $("#txbnewpsw").val();
            var txbrepsw = $("#txbrepsw").val();
            if (txbnewpsw.length > 20) {
                alert("密码过长,请缩短至20位以内");
                return;
            }
            if (txbrepsw != txbnewpsw) {
                alert("两次新密码输入不一致！请确认");
                return;
            } else {
                $.getJSON("http://" + url + "/smstask/ChangePSw.aspx?Uname=" + uname + "&oldPsw=" + txboldpsw + "&newPsw=" + txbnewpsw + "&jsoncallback=?",
                function (json) {

                    if (json[0].R == "True") {

                        if (json[1].result == "修改密码成功！") {
                            $("#txbuname").val("");//清空
                            $("#txboldpsw").val("");
                            $("#txbnewpsw").val("");
                            $("#txbrepsw").val("");
                        }
                        alert(json[1].result)
                    }
                    else {
                        $("#DivResult").html('请稍候再试');
                    }
                })
            }
        }
        function GetMoney(url, senderid) {

            $.getJSON("http://" + url + "/smstask/PayMoney.aspx?userid=" + senderid + "&jsoncallback=?",
                function (json) {

                    if (json[0].R == "True") {
                        var paymoney = json[1].paymoney;

                        $("#DivResult").html(paymoney + "元");
                    }
                    else {
                        $("#DivResult").html('请稍候再试');
                    }
                })

        }
    </script>
</head>
<body style="overflow-x: hidden">
    <form id="form1" runat="server">
    <div>
        <table width="100%" class="tableBorder" border='1' cellspacing="0" style="border-collapse: collapse;"
            bgcolor="#ffffff" bordercolor="#cccccc">
            <tr align="center" valign="middle">
                <th height="22" colspan="88">
                    短 信 平 台 账 号 管 理
                </th>
            </tr>
            <tr>
                <td>
                    操作
                </td>
                <td>
                    <input type="button" class="btn" value="刷新" onclick="Refresh()" />
                    <asp:Button runat="server" ID="btnexcel" Text="导出Excel" OnClick="btnexcel_Click"
                        CssClass="btn" />
                </td>
            </tr>
            <tr>
                <td>
                    密码变更
                </td>
                <td>
                    用户名:
                    <input type="text" id="txbuname" />
                    原密码:
                    <input type="text" id="txboldpsw" />
                    新密码:
                    <input type="password" id="txbnewpsw" />
                    确认密码:
                    <input type="password" id="txbrepsw" />
                    <input type="button" class="btn" value="确定修改" onclick="ChangePsw()" />
                </td>
            </tr>
            <asp:Panel runat="server" ID="plop">
                <tr style='display: none'>
                    <td>
                        id
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txbid"></asp:TextBox>
                    </td>
                </tr>
                <tr style='display: none'>
                    <td>
                        用户名
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txbsenderName" Width="60%"></asp:TextBox>
                    </td>
                </tr>
                <tr style='display: none'>
                    <td>
                        用户密码
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txbsenderPsw" Width="60%"></asp:TextBox>
                    </td>
                </tr>
                <tr style='display: none'>
                    <td>
                        用户编码
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txbsenderID" Width="60%"></asp:TextBox>平台提供，发短信时平台会验证
                    </td>
                </tr>
                <tr style='display: none'>
                    <td>
                        服务器地址
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txbserverUrl" Width="60%"></asp:TextBox>短信平台IP地址，勿动
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Button runat="server" CssClass="btn" ID="btnServerInfoOk" Text="确定" OnClick="btnServerInfoOk_Click" />
                    </td>
                </tr>
            </asp:Panel>
        </table>
        <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    <asp:GridView ID="gvList" runat="server" AllowPaging="false" CellPadding="2" AutoGenerateColumns="False"
                        GridLines="Both" EmptyDataText="当前页无数据" CssClass="tableBorder" Width="100%">
                        <Columns>
                            <asp:BoundField DataField="id" HeaderText="id" Visible="false" />
                            <asp:BoundField DataField="senderName" HeaderText="用户名" />
                            <asp:BoundField DataField="senderID" HeaderText="用户编码" />
                            <asp:BoundField DataField="serverUrl" HeaderText="服务器地址" />
                            <asp:BoundField DataField="senderPsw" HeaderText="用户密码" Visible="false" />
                            <asp:TemplateField HeaderText="查看余额">
                                <ItemTemplate>
                                    <input class="btn" type="button" onclick="GetMoney('<%#Eval("serverUrl") %>','<%#Eval("senderID") %>')"
                                        value="查看余额" />
                                    <div id="DivResult">
                                    </div>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作" Visible="false">
                                <ItemTemplate>
                                    <%--  <input class="btn" type="button" onclick="Go('?act=mod&id=<%#Eval("id") %>')" value="修改" />--%>
                                    <%-- <input class="btn" type="button" onclick="javascript:if (confirm('您真的确定要删除吗？\n\n请确认！')==true){Go('?act=del&id=<%#Eval("id")%>')}else{return false}"
                                        value="删除" />--%>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerSettings Visible="False" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        <asp:Literal runat="server" ID="litpager"></asp:Literal>
    </div>
    </form>
    <script language='javascript' type='text/javascript' src='/JS/tablecolor.js'></script>
    <script type='text/javascript' language='javascript'><!--
        TableColor('gvList', '#F1F8FE', '#FFFFFF', '#F8DC87', '#BCE774');
    --></script>
</body>
</html>
